package springboot.demo.converter;

import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;
import springboot.demo.bean.User;
import springboot.demo.dto.UserDto;

/**
 * User对象转换器
 */
@Mapper
public interface UserConverter {
    
    UserConverter INSTANCE = Mappers.getMapper(UserConverter.class);
    
    /**
     * UserDto转User
     * @param userDto 用户DTO
     * @return User实体
     */
    User toUser(UserDto userDto);
    
    /**
     * User转UserDto
     * @param user User实体
     * @return 用户DTO
     */
    UserDto toUserDto(User user);
} 